<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title>Vue中同时使用过渡和动画</title>
		<script type="text/javascript" src="js/vue.js" ></script>
		<link rel="stylesheet" href="css/animate.css" />
		<style>
			.fade-enter, .fade-leave-to {
				opacity: 0;
			}
			.fade-enter-active, .fade-leave-active {
				transition: opacity 1s;
			}
		</style>
	</head>
	<body>
		<div id="root">
			<transition
				:duration="{enter: 5000, leave: 10000}"
				name="fade"
				appear
				enter-active-class="animated flash fade-enter-active"
				leave-active-class="animated bounceOutLeft fade-leave-active"
				appear-active-class="animated flash"
			>
				<div v-show="show">Hello World</div>
			</transition>
        	<button @click="handleBtnClick">切换</button>
        </div>
		
		<script>
			var vm = new Vue({
				el: '#root',
				data: {
					show: true
				},
				methods: {
					handleBtnClick: function() {
						this.show = !this.show
					}
				}
			})
			
		</script>
	</body>
</html>
